package daniel.taotao.exception;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;

public class HandExceptionResolver implements HandlerExceptionResolver {
	Logger logger=LoggerFactory.getLogger(HandExceptionResolver.class);
	@Override
	public ModelAndView resolveException(HttpServletRequest arg0, HttpServletResponse arg1, Object arg2,
			Exception arg3) {
		logger.error("error~~~", arg3);
		ModelAndView m=new ModelAndView();
		m.addObject("message", "errorle");
		m.setViewName("error/exception");
		return m;
	}

}
